package com.epcs.controller.action;

import org.apache.struts2.dispatcher.SessionMap;

import com.epcs.model.bo.SynchronizationBO;
import com.epcs.model.dto.Account;

public class SynchronizationThread implements Runnable {

	private Account account;
	private SessionMap<String, Object> sessionMap;
	
	
	public SynchronizationThread(Account account, SessionMap<String, Object> sessionMap) {
		super();
		this.account = account;
		this.sessionMap = sessionMap;
	}

	@Override
	public void run() {

		int result = new SynchronizationBO().synchronize(account);
		
		if (result == 1) {
			sessionMap.put("SYNC_STATUS", "Success");
			
		} else {
			sessionMap.put("SYNC_STATUS", "Fail");
		}

	}

}
